#include<reg52.h>
#include"intrins.h"
#define uchar unsigned char
#define uint  unsigned int
uchar code bujinz[]={~0x01,~0x03,~0x02,~0x06,~0x04,~0x0c,~0x08,~0x09};
uchar code bujinf[]={~0x09,~0x08,~0x0c,~0x04,~0x06,~0x02,~0x03,~0x01};
void Delay1ms()
{
	unsigned char i,j;
	_nop_();
	_nop_();
	_nop_();
	i=11;
	j=190;
	do
	{
		while(--j);
	}while(--i);
}
void Delay999ms()
{
	unsigned char i,j,k;
	_nop_();
	_nop_();
	_nop_();
	i=42;
	j=252;
	k=9;
	do
	{
		do
		{
			while(--k);
		}while(--j);
	}while(--i);
	
}
void bujinzheng(uchar a,uint b)
{
	uchar x,j;
	double c;
	for(c=64/5.625*b;c>0;c--)
	{
		P1=bujinz[x];
		x++;
		if(x==8)
		x=0;
		for(j=a;j>0;j--)
		Delay1ms();
	}
}
void bujinfan(uchar a,uint b)
{
	uchar x,j;
	double c;
	for(c=64/5.625*b;c>0;c--)
	{
		P1=bujinf[x];
		x++;
		if(x==8)
		x=0;
		for(j=a;j>0;j--)
		Delay1ms();
	}
}
void main()
{
	bujinzheng(4,180);
	Delay999ms();
	bujinfan(4,90);
	Delay999ms();
	while(1);
}
